import $store from '@/store/index.js';
export default {
	/* 修改个人信息 */
	async userEdit(data) {
		try{
			let res = await uni.$api.user.userEdit(data)
			if(res){
				uni.showToast({
					title:res.msg,
					icon:'none'
				})
				$store.dispatch('uploadUserInfo',data)
				return true
			}else{
				return false
			}
		}catch(e){
			throw e;
		}
	},
	async userEditOther(data) {
		try{
			let res = await uni.$api.user.userEditOther(data)
			if(res){
				uni.showToast({
					title:res.msg,
					icon:'none'
				})
				$store.dispatch('uploadUserInfo',data)
				return true
			}else{
				return false
			}
		}catch(e){
			throw e;
		}
	},
	
}